package com.spring.cloud.entity;

import java.io.Serializable;

import static com.spring.cloud.entity.Status.FAIL;
import static com.spring.cloud.entity.Status.SUCCESS;

/**
 *  @author wushihao
 *  @date   2020/4/5
 *  @desc   返回util
 */
public class ResultUtil implements Serializable {
    private static final long serialVersionUID = -4478950283564020115L;

    public static Result<Object> success(Object data){
        Integer code = 200;
        String status = SUCCESS;
       return new Result<Object>(code,status,data);
    }

    public static Result<Object> succss(){
        Integer code = 200;
        String status = SUCCESS;
        return new Result<Object>(code,status);
    }

    public static Result<Object> fail(){
        Integer code = 500;
        String status = FAIL;
        return new Result<Object>(code,status);
    }
}
